<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Object.fromEntries</title>
</head>
<body>
<script>
  //Object.fromEntries -- 将二维数组转化为对象
  const result=Object.fromEntries([
          ['name','zhangSan'],
          ['age',14],
          ['sex','woman']
  ])
  console.log(result)

  //Map
  const map=new Map();
  map.set('name','liSi')
  map.set('age','25')
  map.set('sex','man')
  const result1=Object.fromEntries(map)//转换为对象
  console.log(result1)

  //Object.entries -- 将对象转换为二维数组
  const arr=Object.entries(result1)
  console.log(arr)
</script>
</body>
</html>